const entSpeak=()=>{
    setSpeaking(false)
    message.info('讲话结束')
    recorder.stop()
    const babo=recorder.getPCMBlob()
    console.log(babo,'babo')
    //转为base64
    const reader=new FileReader();
    reader.readAsDataURL(babo);
    reader.onload=async(e)=>{
        const base64=e.target?.result as string;
        const base64data=base64.split(',')[1];
        const res=await getWenzi(yytoken,base64data,babo.size)
        console.log(yytoken,'res')
        console.log(res,'dd')
        //调用转文字接口
        const {data:{reslt:[myText]}}=await getWenzi(yytoken,base64data,babo.size)
        setList((list1:any)=>[...list1,{text:myText,id:Math.random().toString().slice(1,7),flag:1}])
        //调用百度云接口获取token
        const optionToken={
            url:'/getAIToken',
            method:'post',
            'headers':{
                'Content-Type':'application/json',
                'X-Appbuilder-Authorization':'Bearer bce-v3/ALTAK-DJ7QNpQkM4TzQ2YHhjHml/f5756b73ca61bd5035850c35d6f3011bf7abf2a5 '
            },
            data:JSON.stringify({
                'app_id':'f94632e6-e650-41d3-889c-14171687dd09'
            })
        }
        const {data:{conversation_id}}=await axios(optionToken)
        const optionsyy={
            'method':'POST',
              'url': '/chat',
        'headers': {
          'Content-Type': 'application/json',
          'X-Appbuilder-Authorization': 'Bearer bce-v3/ALTAK-DJ7QNpQkM4TzQ2YHhjHml/f5756b73ca61bd5035850c35d6f3011bf7abf2a5'
        },
        data:JSON.stringify({
            "app_id": "f94632e6-e650-41d3-889c-14171687dd09",
          "query": myText,
          "conversation_id": conversation_id,
          "stream": false
        })
        };
        const {data:{answer}}=await.axios(optionsyy)
        console.log(answer,'answer')
        
    }
}